# -*- coding: utf-8 -*-
from PySide.QtCore import QRect
from PySide.QtGui import QApplication, QDialog, QLabel, QFont, QPushButton
from value import __version__


class AboutDialog(QDialog):
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.setWindowTitle(
            QApplication.translate("AboutDialog", "About", None, QApplication.UnicodeUTF8))
        self.info = QLabel(self)
        self.info.setGeometry(QRect(20, 0, 300, 120))
        font = QFont("Arial", 14, QFont.Bold, italic=True)
        self.info.setFont(font)
        self.info.setObjectName("info")
        self.info.setText(QApplication.translate("AboutDialog", " name:FileEditor\n"
                                                                " version:" + __version__ + "\n"
                                                                                            " code by tzh\n"
                                                                                            " email:tzh1234@gmail.com\n"
                                                                                            " powerd by pyside",
                                                 None,
                                                 QApplication.UnicodeUTF8))

        self.okButton = QPushButton(self)
        self.okButton.setGeometry(QRect(300, 120, 80, 30))
        self.okButton.setObjectName("okButton")
        self.okButton.setText(QApplication.translate("AboutDialog", "&OK", None, QApplication.UnicodeUTF8))
        self.okButton.clicked.connect(self.close)
        self.setMinimumHeight(180)
        self.setMaximumHeight(200)
        self.setMinimumWidth(400)
        self.setMaximumWidth(450)
